﻿
Public Class [date]
    Public Shared Function invoke(Optional ByRef actionTarget As String = Nothing) As String
        actionTarget += "Date()"
        Return actionTarget
    End Function
End Class

Public Class localenow
    Public Const functionName As String = "lclnw"

    Public Shared Sub register(ByVal inlineScript As inlineScript)
        assert(Not inlineScript Is Nothing, "inlineScript is nothing.")
        inlineScript.addscript("localenow", "function " + functionName + "(){" + _
                               "return (new Date()).toLocaleString();}")
    End Sub

    Public Shared Function invoke(ByVal inlineScript As inlineScript, _
                                  Optional ByRef actionTarget As String = Nothing) As String
        If Not inlineScript Is Nothing Then
            register(inlineScript)
        End If

        actionTarget += functionName + "()"
        Return actionTarget
    End Function
End Class
